<template>
 <div class="Special">
     <header @click="$router.push('/home')">严选专栏</header>
     <ul>
         <li v-for="item in list" :key="item.id" @click="$router.push('/SpecialOne?id='+item.id)">
             <img :src="item.pic" alt="">
             <p>{{item.title}}</p>
             <p>{{item.descript}}</p>
         </li>
     </ul>
 </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      list: []
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    async getList() {
      let { data: res } = await this.$http.get(
        "https://api.it120.cc/small4/cms/news/list"
      );
      //   console.log(res);
      this.list = res.data;
    }
  },
  computed: {},
  watch: {}
};
</script>

<style scoped>
.Special {
  width: 100%;
  overflow: hidden;
}
header {
  width: 100%;
  height: 50px;
  line-height: 50px;
  border-bottom: 1px #ccc solid;
  text-align: center;
  margin-bottom: 10px;
}
li {
  width: 100%;
  height: 184px;
  list-style: none;
  margin-bottom: 10px;
  position: relative;
}
ul > li > img {
  width: 100%;
  height: 100%;
}
ul > li > p {
  width: 100%;
  height: 30px;
  margin-top: 10px;
  text-align: center;
  color: aquamarine;
  position: absolute;
  top: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
ul > li > p:nth-child(2) {
  display: block;
  width: 100%;
  position: absolute;
  top: 100px;
  color: aqua;
}
</style>